﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;

namespace NextMachine
{
    public partial class WindowViewModelBase : ObservableObject
    {
        [ObservableProperty]
        string windowCaption = "";
        [RelayCommand]
        void WindowMinimize(object obj)
        {
            Window? window = obj as Window;
            if (window != null)
            {
                window.WindowState = WindowState.Minimized;
            }
        }
        [RelayCommand]
        void WindowRestore(object obj)
        {
            Window? window = obj as Window;
            if (window != null)
            {
                if (window.WindowState == WindowState.Normal)
                    window.WindowState = WindowState.Maximized;
                else if (window.WindowState == WindowState.Maximized)
                    window.WindowState = WindowState.Normal;
            }
        }
    }
}
